package com.myblog.controller;

import com.myblog.annotation.Log;
import com.myblog.domain.GlobalResponse;
import com.myblog.services.UploadService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

@RestController
@RequestMapping
@Api(tags = "评论控制器")
public class UploadController {

    @Resource
    UploadService uploadService;
    @Log(BusinessName = "上传头像")
    @PostMapping("/upload")
    @ApiOperation("上传头像")
    public GlobalResponse upload(MultipartFile img){
        return uploadService.upload(img);
    }
}
